import consts from "../../../utils/consts.js"

var app = getApp()
Page({
  data: {
    times: [],
    start: 9,
    end: 21,
    submiting: false,
    submitDisable: false
  },
  bindStartWorkChange: function (e) {
    var sel = Number(e.detail.value)
    if (sel > this.data.end) {
      this.setData({
        start: sel,
        end: sel
      })
    } else {
      this.setData({
        start: sel
      })
    }
  },
  bindEndWorkChange: function (e) {
    var sel = Number(e.detail.value)
    if (sel < this.data.start) {
      this.setData({
        end: this.data.start
      })
    } else {
      this.setData({
        end: sel
      })
    }
  },
  bindSubmitTap: function (e) {
    wx.setStorageSync(consts.storage_key_stime, this.data.start)
    wx.setStorageSync(consts.storage_key_etime, this.data.end)
    wx.navigateTo({
      url: "/pages/my/course-fixed/index"
    })
  },
  onLoad: function () {
    console.log("consts.times")
    console.log(consts.times)
    this.setData({
      times: consts.times
    })
  }
})